﻿@model PluginModel
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body">
                    <div class="layui-form" wid100 lay-filter="">
                        <input asp-for="SystemName" type="hidden" />
                        <div class="layui-form-item">
                            <u-label asp-for="FriendlyName" />
                            <div class="layui-input-inline">
                                <u-editor asp-for="FriendlyName" />
                                <span asp-validation-for="FriendlyName"></span>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <u-label asp-for="DisplayOrder" />
                            <div class="layui-input-inline">
                                <u-editor asp-for="DisplayOrder" />
                                <span asp-validation-for="DisplayOrder"></span>
                            </div>
                        </div>
                        @if (Model.CanChangeEnabled)
                        {
                            <div class="layui-form-item">
                                <u-label asp-for="IsEnabled" />
                                <div class="layui-input-inline">
                                    <u-bool asp-for="IsEnabled" />
                                    <span asp-validation-for="IsEnabled"></span>
                                </div>
                            </div>
                        }
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    layui.config({
        base: '../../../layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'set'], function () {
        var $ = layui.$
            , form = layui.form
            ,active = { }
        form.on('submit(set_system_submit_btn)', function (obj) {
          var field = obj.field; //获取提交的字段
            //layer.msg(JSON.stringify(obj.field));
            //提交 Ajax 成功后，关闭当前弹层并重载表格
            $.post('@Url.Action("EditPopup")', field, function (rep) {
                if (rep.success==1)
              layer.msg('保存成功');
            });
            return false;
    });
        $('.layui-btn.layuiadmin-btn-tags').on('click', function () {
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });

    });
</script>
